package org.minproject.my_library_back.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName borrow
 */
@TableName(value ="borrow")
@Data
public class Borrow implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer borrowId;

    /**
     * 
     */
    private Integer userId;

    /**
     * 
     */
    private Integer bookId;

    /**
     * 
     */
    private Date borrowTime1;

    /**
     * 
     */
    private Date borrowTime2;

    /**
     * 
     */
    private Integer borrowNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Borrow other = (Borrow) that;
        return (this.getBorrowId() == null ? other.getBorrowId() == null : this.getBorrowId().equals(other.getBorrowId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBorrowTime1() == null ? other.getBorrowTime1() == null : this.getBorrowTime1().equals(other.getBorrowTime1()))
            && (this.getBorrowTime2() == null ? other.getBorrowTime2() == null : this.getBorrowTime2().equals(other.getBorrowTime2()))
            && (this.getBorrowNum() == null ? other.getBorrowNum() == null : this.getBorrowNum().equals(other.getBorrowNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBorrowId() == null) ? 0 : getBorrowId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBorrowTime1() == null) ? 0 : getBorrowTime1().hashCode());
        result = prime * result + ((getBorrowTime2() == null) ? 0 : getBorrowTime2().hashCode());
        result = prime * result + ((getBorrowNum() == null) ? 0 : getBorrowNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", borrowId=").append(borrowId);
        sb.append(", userId=").append(userId);
        sb.append(", bookId=").append(bookId);
        sb.append(", borrowTime1=").append(borrowTime1);
        sb.append(", borrowTime2=").append(borrowTime2);
        sb.append(", borrowNum=").append(borrowNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}